<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRefundsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('refunds', function (Blueprint $table) {
            $table->id();
            $table->string('order_no')->index()->comment('订单号');
            $table->string('refund_no')->index()->comment('退款单号');
            $table->integer('refund_amount')->comment('退款总金额.单位：分');
            $table->integer('balance_amount')->comment('余额账户退款金额.单位：分');
            $table->string('platform')->comment('请求端平台');
            $table->tinyInteger('status')->default(0)->comment('退款状态:0-退款中；1-退款成功；2-退款失败；3-部分退款成功');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
